{% with messages = request.get('flash', []) %}
  {% if messages %}
    <div class="mb-4">
      {% for category, message in messages %}
        <div class="
          {% if category == 'success' %} bg-green-100 border-green-400 text-green-700
          {% elif category == 'error' %} bg-red-100 border-red-400 text-red-700
          {% else %} bg-blue-100 border-blue-400 text-blue-700
          {% endif %}
          border px-4 py-3 rounded relative" role="alert">
          <span class="block sm:inline">{{ message }}</span>
        </div>
      {% endfor %}
    </div>
  {% endif %}
{% endwith %}